import java.io.File;
import java.io.FileNotFoundException;
import java.io.PrintStream;



public class WriteTSP2
{
	PrintStream out ;
	
	public WriteTSP2(Node[] sequence,File outFile,ReadHCPScanner r) throws FileNotFoundException
	{
	out = new PrintStream(outFile);
	
	
	if (r.name != null) {
		out.println("NAME : " + r.name);
	}

	if (r.comment != null) {
		out.println("COMMENT : " + r.comment);
	}

		out.println("TYPE : TSP" );
		out.println("DIMENSION : " + (sequence.length -1));
		out.println("EDGE_WEIGHT_TYPE : EXPLICIT" );
		out.println("EDGE_WEIGHT_FORMAT : LOWER_DIAG_ROW" );
		out.println("EDGE_WEIGHT_SECTION");
		out.println("0");
		
		
	for(int x = 2; x < sequence.length; x++) // prints out a 1 if the array has an edge , otherwise 2
	{
		for(int y = 1; y < x; y ++)
		{
			
		if(sequence[x].array[y].index != 0)
			out.println("1");
		else 
			out.println("2");
			
			
			
		}
		
		
		out.println("0");
		
		
	}
	
	out.println("-1\nEOF");
	out.close();

	
	
	

	
	
	
	
	
	
}}

